package study.translation.interpreter;

import java.util.HashMap;
import java.util.Map;

public class ExecutionContext
{
    private Map<String, Variable> variables = new HashMap<String, Variable>();

    public void registerVariable( Variable var )
    {
        variables.put( var.getName(), var );
    }

    public void unregisterVariable( String name )
    {
        variables.remove( name );
    }

    public Variable getVariable( String name )
    {
        return variables.get( name );
    }

    public boolean variableExists( String name )
    {
        return variables.containsKey( name );
    }
}
